//package com.example.springsecurityoauthdemo.config;
//
//import com.example.springsecurityoauthdemo.handler.MyAuthenticationFailHandler;
//import com.example.springsecurityoauthdemo.handler.MyAuthenticationSuccessHandler;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.security.SecurityProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.builders.WebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
///**
// * @author YCL
// * @version 1.0
// * @Description
// * @date 2021/9/30
// */
//@Configuration
//public class MySecurityConfig extends WebSecurityConfigurerAdapter {
//    @Autowired
//    private SecurityProperties securityProperties;
//
//    /**
//     * 注入 自定义的  登录成功处理类
//     */
//    @Autowired
//    private MyAuthenticationSuccessHandler mySuccessHandler;
//    @Autowired
//    private MyAuthenticationFailHandler myFailHandler;
//
//    /**
//     * 重写PasswordEncoder  接口中的方法，实例化加密策略
//     * @return 返回 BCrypt 加密策略
//     */
//    @Bean
//    public PasswordEncoder passwordEncoder(){
//        return new BCryptPasswordEncoder();
//    }
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http.formLogin()
//                .successHandler(mySuccessHandler)
//                .failureHandler(myFailHandler)
//                .and()
//                .authorizeRequests()
//                .antMatchers();
//    }
//
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        super.configure(auth);
//    }
//
//    @Override
//    public void configure(WebSecurity web) throws Exception {
//        super.configure(web);
//    }
//}
